<?php echo $html->css("screen/staff_parts.css");?>
<?php echo $this->element('menu', array("active" => "2.b"));?>
<div id="content" class="parts index">
<?php echo $this->Html->link(__('Add product', true), array('action' => 'add'), array('class'=>'bt')); ?>		
	<div class="table table_p_15_2 boder">
	  <table cellpadding="0" cellspacing="0" align="right" width="100%">
		<thead>
		<tr>				
			<td><?php echo $this->Paginator->sort('name');?></td>
			<td><?php echo $this->Paginator->sort('Category','part_category_id');?></td>
			<td><?php echo $this->Paginator->sort('price');?></td>
			<td><?php echo $this->Paginator->sort('Make','part_manufacturer_id');?></td>			
			<td><?php echo $this->Paginator->sort('photo1');?></td>
			<td><?php echo $this->Paginator->sort('photo2');?></td>
			<td><?php echo $this->Paginator->sort('photo3');?></td>
			<td><?php echo $this->Paginator->sort('photo4');?></td>			
			<td class="actions"><?php __('Actions');?></td>
		</tr>
		</thead>
	<tbody>
	<?php
	$i = 0;
	foreach ($parts as $part):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>		
		<td><?php echo $part['Part']['name']; ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($part['PartCategory']['category'], array('controller' => 'part_categories', 'action' => 'view', $part['PartCategory']['id'])); ?>
		</td>
		<td><?php echo $part['Part']['price']; ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($part['PartManufacturer']['name'], array('controller' => 'part_manufacturers', 'action' => 'view', $part['PartManufacturer']['id'])); ?>
		</td>		
		<td><img src="<?php echo $this->webroot.'files/uploads/categories/'.$part['Part']['photo1']; ?>" class="thumbnail" />&nbsp;</td>		
		<td><img src="<?php echo $this->webroot.'files/uploads/categories/'.$part['Part']['photo2']; ?>" class="thumbnail" />&nbsp;</td>		
		<td><img src="<?php echo $this->webroot.'files/uploads/categories/'.$part['Part']['photo3']; ?>" class="thumbnail" />&nbsp;</td>		
		<td><img src="<?php echo $this->webroot.'files/uploads/categories/'.$part['Part']['photo4']; ?>" class="thumbnail" />&nbsp;</td>				
		<td class="actions">			
			<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $part['Part']['id'])); ?>
			|&nbsp;<?php echo $this->Html->link(__('Remove', true), array('action' => 'delete', $part['Part']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $part['Part']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</tbody>
	</table>
	</div>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>